package com.cskaoyan.demo5.aspect;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class LogAspect {

    //@Pointcut("execution(* com.cskaoyan..service.*ServiceImpl.insert(..))")
    @Pointcut("@annotation(com.cskaoyan.demo5.annotation.Log)")
    public void pt() {}

    @Before("pt()")
    public void beforeAdvice(){
        System.out.println("这是一个前置通知");
    }
}
